package businesslogic;

import java.rmi.RemoteException;

import databaseservice.UserPOService;
import po.UserPO;
import businesslogic.network.RMIStubClient;
import businesslogicservice.AdminBLService;

public class AdminBLService_Stub implements AdminBLService {
	
	UserPOService userPOService;
	
	public AdminBLService_Stub(RMIStubClient client){
		this.userPOService = client.userPOService;
	}

	@Override
	public boolean add(UserPO user) {
		try {
			userPOService.add(user);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return true;
	}

	@Override
	public boolean delete(UserPO user) {
			
			try {
				userPOService.delete(user);
			} catch (RemoteException e) {
				e.printStackTrace();
			}
		
		return true;
	}

	@Override
	public boolean alter(UserPO oldUser, UserPO newUser) {
		
			try {
				userPOService.alter(oldUser, newUser);
			} catch (RemoteException e) {
				e.printStackTrace();
			}
		
		return true;
	}

	@Override
	public UserPO select(UserPO user) {
		// TODO Auto-generated method stub
		
			try {
				userPOService.search(user);
			} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		return null;
	}

}
